<?php

namespace app\common\model;

use think\Model;


class Payment extends Model
{

    

    

    // 表名
    protected $name = 'payment';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'method_text'
    ];
    

    
    public function getMethodList()
    {
        return ['微信' => __('微信'), '月卡' => __('月卡')];
    }


    public function getMethodTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['method']) ? $data['method'] : '');
        $list = $this->getMethodList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
